package mymyoux.io
{
	import flash.events.Event;
	import flash.net.URLLoader;
	
	import mymyoux.core.SString;
	import mymyoux.debug.Log;
	import mymyoux.events.IMEventDispatcher;
	import mymyoux.events.LoadEvent;
	import mymyoux.events.MEventDispatcher;
	public class LoadAdvTextFile extends LoadTextFile implements IMEventDispatcher
	{
		static protected var static_meventdispatcher:MEventDispatcher;
		static public const ERROR:String="error";
		static public const LOADING:String="loading";
		static public const OPEN:String="open";
		static public const COMPLETED:String="scompleted";
		public function LoadAdvTextFile(url:String=null,args:Parameters=null){
			if(url!=null){
				super(url,args);
			}
		}
		protected override function Completed(e:Event):void{
			try{
				this.dispatchEvent(new LoadEvent(f.url,_args,COMPLETED,new SString((e.target as URLLoader).data),(e.target as URLLoader).bytesTotal,(e.target as URLLoader).bytesTotal));
			}catch(err:Error){
				trace("Err:"+err);
				this.dispatchEvent(new LoadEvent(f.url,_args,ERROR));
			}
			destroy();
		}
	}
}